%%
%作业2
%1
syms x
y = x.^5-9*x.^4+31*x.^3-51*x.^2+40*x-12;
a = factor(y);
f1 = -6+x.^3-6*x.^2+11*x;
b = factor(f1);
%%
%2
clear,clc
% 定义求和的项数
syms x
s1 = symsum((-1)^(x+1)./((3^x)*x),x,1,inf);
%%
%3
clear,clc
syms x
f = sin(x)*cos(2*x)+1;
[x,y] = fminbnd('-sin(x)*cos(2*x)-1',0,pi);
fplot(f);
%3(2)
clear,clc
syms x
f = (x*(1-x))/(x^2+(1-x)^2);
[x,y] = fminbnd('-(x*(1-x))/(x^2+(1-x)^2)',0,1);
fplot(f);
hold off
%%
%4
clear,clc
syms x
ff = exp(-(x.^2./2));
int(ff,x,-inf,inf);
f = (1+(sin(x)).^2)^1/2;
int(f,x,0,pi/2);
%%
%5
clear
syms x n
y = (1+x/n)^n;
limit(y,n,inf);
y2 = (((factorial(n))^2)/(n^(2*n)))^(1/n);
limit(y2,n,inf);
%%
%6
clear,clc
syms n
%y = 1/(n^4);
s1 = symsum(1/(n^4),n,1,inf)



